avoid numa placement of cpus with active cpupools
authorJuergen Gross <juergen.gross@ts.fujitsu.com>
Thu, 28 Oct 2010 11:22:09 +0000 (12:22 +0100)
committerJuergen Gross <juergen.gross@ts.fujitsu.com>
Thu, 28 Oct 2010 11:22:09 +0000 (12:22 +0100)
When using cpupools don't pin vcpus to numa nodes as this might
conflict with the cpupool definition.
numa placement should be handled by cpupool configuration instead.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/python/xen/xend/XendCPUPool.py
tools/python/xen/xend/XendDomainInfo.py

index 71a79e873f94d2be375ca43ec93d77e7b8ba2033..d26cbd6068902d8d459a67dfc7f6f6b2a107e282 100644 (file)
@@ -883,6 +883,11 @@ class XendCPUPool(XendBase):
     lookup_pool = classmethod(lookup_pool)
 
 
+    def number_of_pools(cls):
+        return len(xc.cpupool_getinfo())
+
+    number_of_pools = classmethod(number_of_pools)
+
     def _cpu_number_to_ref(cls, number):
         node = XendNode.instance()
         for cpu_ref in node.get_host_cpu_refs():
index 4360ce24922974eb0ca7bad9f9f46c08a55dff1c..6c4b04447831bf40adf5e838c69ff37ed7edbcc2 100644 (file)
@@ -2748,7 +2748,7 @@ class XendDomainInfo:
                 return map(lambda x: x[0], sorted(enumerate(nodeload), key=lambda x:x[1]))
 
             info = xc.numainfo()
-            if info['max_node_index'] > 0:
+            if info['max_node_index'] > 0 and  XendCPUPool.number_of_pools() < 2:
                 node_memory_list = info['node_memfree']
                 node_to_cpu = []
                 for i in range(0, info['max_node_index'] + 1):